Skip to content

Add Tautulli sensor platform#17835

Merged
fabaff merged 10 commits intohome-assistant:devfrom
ludeeus:tautulli
Nov 3, 2018
Merged

Add Tautulli sensor platform#17835
fabaff merged 10 commits intohome-assistant:devfrom
ludeeus:tautulli

Conversation

@ludeeus
Copy link
Copy Markdown
Member

@ludeeus ludeeus commented Oct 26, 2018

Description:

This PR adds a Tautulli sensor platform to display statistics from a Tautulli server.

Related issue (if applicable): fixes #

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#7151

Example entry for configuration.yaml (if applicable):

sensor:
  - platform: tautulli
    api_key: 24b6eac0a858748664878d146bf63623b4
    host: 192.168.1.14

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • New dependencies have been added to the REQUIREMENTS variable (example).
  • New dependencies are only imported inside functions that use them (example).
  • New or updated dependencies have been added to requirements_all.txt by running script/gen_requirements_all.py.
  • New files were added to .coveragerc.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@ludeeus ludeeus changed the title WIP: Adds Tautulli as a sensor platform. Adds Tautulli as a sensor platform. Oct 27, 2018
@ludeeus ludeeus changed the title Adds Tautulli as a sensor platform. WIP: Adds Tautulli as a sensor platform. Oct 28, 2018
@ludeeus
Copy link
Copy Markdown
Member Author

ludeeus commented Oct 28, 2018

Thanks for the input @fabaff

@digiblur
Copy link
Copy Markdown
Contributor

Cool to see this being folded in! Great job! Curious if we would be able to added two Tautulli different IP monitoring sessions with this?

@ludeeus
Copy link
Copy Markdown
Member Author

ludeeus commented Oct 29, 2018

@digiblur when if this gets accepted you can add multiple sensors like most other entities in Home Assistant:

sensor:
  - platform: tautulli
    host: 192.168.1.11
    ...
  - platform: tautulli
    host: 192.168.1.12
    ...

@ludeeus ludeeus changed the title WIP: Adds Tautulli as a sensor platform. Adds Tautulli as a sensor platform. Oct 31, 2018
@ludeeus
Copy link
Copy Markdown
Member Author

ludeeus commented Oct 31, 2018

@fabaff I think I have now changed all requested parts.
Like you said I had to rewrite the library it uses 👍

@MartinHjelmare MartinHjelmare changed the title Adds Tautulli as a sensor platform. Add Tautulli sensor platform Oct 31, 2018
Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@MartinHjelmare
Copy link
Copy Markdown
Member

Can be merged when build passes.

@ghost ghost assigned fabaff Nov 2, 2018
@fabaff fabaff merged commit 610b0b6 into home-assistant:dev Nov 3, 2018
@ghost ghost removed the in progress label Nov 3, 2018
@ludeeus ludeeus deleted the tautulli branch November 3, 2018 22:48
@balloob balloob mentioned this pull request Nov 29, 2018
@riker09
Copy link
Copy Markdown

riker09 commented Nov 29, 2018

Sorry, but:

tautulli: Error on device update!
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 248, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 347, in async_device_update
    await self.async_update()
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/tautulli.py", line 93, in async_update
    self._attributes['Top Movie'] = self.home[0]['rows'][0]['title']
IndexError: list index out of range

@MartinHjelmare
Copy link
Copy Markdown
Member

Please open an issue if you suspect a bug. If you need help please use our help channels:
https://home-assistant.io/help/#communication-channels

Merged PRs should not be used for support or bug reports. Thanks!

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Nov 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants